package com.yqg.protection.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yqg.protection.controller.dto.MapDataDto;
import com.yqg.protection.entity.EquipmentInputStore;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author zxf
 * @since 2024-01-01
 */
@Mapper
public interface EquipmentInputStoreMapper extends BaseMapper<EquipmentInputStore> {

    List<EquipmentInputStore> findPage(Integer pageNum, Integer pageSize, String equipmentName, String equipmentId, Integer level, Long organizationId, String state, Integer systemId, Integer type, String SIMId, String clientName, String isAllClient, List<Long> clientIds, Long id);

    Long findPageCount(String equipmentName, String equipmentId, Integer level, Long organizationId, String state, Integer systemId, Integer type, String SIMId, String clientName, String isAllClient, List<Long> clientIds);

    @Select("select * from equipment_input_store where !ISNULL(page_turn_name) group by page_turn_name")
    List<EquipmentInputStore> findAllUrlName();

    List<Map<String, Integer>> findTypeCount(Integer level, Long organizationId, String isAllClient, List<Long> clientIds, Long clientId);

    List<EquipmentInputStore> selectlist(Integer level, Long organizationId, String isAllClient, Integer systemId, List<Long> clientIds, Long clientId);

    List<EquipmentInputStore> findNoBindingSIMPage(Integer pageNum, Integer pageSize, String equipmentId, Integer level, Long organizationId, String isAllClient, List<Long> clientIds);

    Long findNoBindingSIMPageCount(String equipmentId, Integer level, Long organizationId, String isAllClient, List<Long> clientIds);

    List<Map<String, Integer>> findCountByClient(Long organizationId, Integer level, String isAllClient, List<Long> clientIds);

    List<MapDataDto> findMapByClient(Long organizationId, Integer level, String isAllClient, List<Long> clientIds);

    List<EquipmentInputStore> exportData(String equipmentName, String equipmentId, Integer level, Long organizationId, String state, Integer systemId, Integer type, String SIMId, String clientName, String isAllClient, List<Long> clientIds);

    List<Map<String, Object>> findCountGroupByOnline(Integer level, Long organizationId, String isAllClient, List<Long> clientIds);

    List<Map<String, Object>> findCountByOnline(Long organizationId, Integer level, String isAllClient, List<Long> clientIds);

    List<EquipmentInputStore> findPageApp(Integer pageNum, Integer pageSize, String equipmentName, Integer level, Long organizationId, Integer type, String online, String isAllClient, List<Long> clientIds);

    Long findPageAppCount(String equipmentName, Integer level, Long organizationId, Integer type, String online, String isAllClient, List<Long> clientIds);

    List<Map<String, Integer>> findCountByClientAndOnline(Long organizationId, Integer level, String isAllClient, List<Long> clientIds);

    List<EquipmentInputStore> findPageExpire(Integer pageNum, Integer pageSize, String equipmentName, Integer level, Long organizationId, Integer isExpire, String isAllClient, List<Long> clientIds);

    Long findPageExpireCount(String equipmentName, Integer level, Long organizationId, Integer isExpire, String isAllClient, List<Long> clientIds);
}
